/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mscs.server.promotion.view;

import java.util.Arrays;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Usbuild
 */
public class TableModelFactory {
    public static final Vector<String> TOTAL_DISCOUNT_COLUMN_NAMES = new Vector(Arrays.asList("额度上限", "额度下限", "折扣率(%)", "开始日期", "结束日期"));
    public static final Vector<String> TOTAL_GIFT_COLUMN_NAMES = new Vector(Arrays.asList("额度", "礼品标识", "礼品数量", "开始日期", "结束日期"));
    public static final Vector<String> SPEC_DISCOUNT_COLUMN_NAMES = new Vector(Arrays.asList("商品标识", "特价", "开始日期", "结束日期"));
    public static final Vector<String> SPEC_GIFT_COLUMN_NAMES = new Vector(Arrays.asList("商品标识", "礼品标识" , "礼品数量", "开始日期" ,"结束日期"));
    public static DefaultTableModel getTotalDiscountTableModel() {
        return new MyTableModel(null, TOTAL_DISCOUNT_COLUMN_NAMES);
    }
    public static DefaultTableModel getTotalGiftTableModel() {
        return new MyTableModel(null, TOTAL_GIFT_COLUMN_NAMES);
    }
    public static DefaultTableModel getSpecDiscountTableModel() {
        return new MyTableModel(null, SPEC_DISCOUNT_COLUMN_NAMES);
    }
    public static DefaultTableModel getSpecGiftTableModel() {
        return new MyTableModel(null, SPEC_GIFT_COLUMN_NAMES);
    }
    
}
class MyTableModel extends DefaultTableModel{
    public MyTableModel(Vector<Vector<String>> data, Vector<String> columnNames) {
        super(data, columnNames);
    }
    public boolean isCellEditable (int row, int column) {
        return false;
    }
}